package weifei.live.simulation.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.springframework.stereotype.Repository;

import java.util.Date;


@Data
@EqualsAndHashCode(callSuper = true)
@TableName("group_live_stream_video_time_cache")
@Repository
public class GroupLiveStreamVideoTimeCache extends Model<GroupLiveStreamVideoTimeCache>
{
    @Getter
    public enum Column
    {
        ID("id"),
        GroupID("group_id"),
        Comment("comment"),
        VideoURL("video_url"),
        StartTime("start_time"),
        EndTime("end_time");

        final String name;
        Column(String name) { this.name = name; }
    }


    @TableId
    private Integer id = 0;
    @NotNull
    private Integer groupId;
    @NotBlank @NotNull
    private String comment;
    @NotBlank @NotNull
    @TableField("video_url")
    private String videoURL;
    @NotNull
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    @NotNull
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;


    public GroupLiveStreamVideoTimeCache() {}
    public GroupLiveStreamVideoTimeCache(int id) { this.id = id; }

}


